# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnector do
  @moduledoc """
  A BeyondCorp connector resource that represents an application facing component deployed proximal to and with direct access to the application instances. It is used to establish connectivity between the remote enterprise environment and GCP. It initiates connections to the applications and can proxy the data from users over the connection.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was created.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. An arbitrary user-provided name for the AppConnector. Cannot exceed 64 characters.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user provided metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Unique resource name of the AppConnector. The name is ignored when creating a AppConnector.
  *   `principalInfo` (*type:* `GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorPrincipalInfo.t`, *default:* `nil`) - Required. Principal information about the Identity of the AppConnector.
  *   `resourceInfo` (*type:* `GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo.t`, *default:* `nil`) - Optional. Resource info of the connector.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the AppConnector.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. A unique identifier for the instance generated by the system.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was last modified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :principalInfo =>
            GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorPrincipalInfo.t()
            | nil,
          :resourceInfo =>
            GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo.t()
            | nil,
          :state => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)
  field(:labels, type: :map)
  field(:name)

  field(:principalInfo,
    as:
      GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorPrincipalInfo
  )

  field(:resourceInfo,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo
  )

  field(:state)
  field(:uid)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnector do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnector.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnector do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
